﻿using Autodesk.AutoCAD.DatabaseServices;
using CADIfox_MVVM.Extension;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Application = Autodesk.AutoCAD.ApplicationServices.Application;

namespace CADIfox_MVVM.Command
{
    public static class ToSatCommand
    {
        [Obsolete]
        public static void ToSat(string path)
        {
            using var tr = new DBTrans();
            if (tr.Editor == null) return;
            var enities = tr.Editor.SelectEntities(tr);

            DBObjectCollection dbobjectCollection = new DBObjectCollection();
            foreach (var enity in enities)
            {
                dbobjectCollection.Add(enity);
            }
            var name = enities.FirstOrDefault().Id.OldId;
            path = Path.Combine(path, name + ".sat");

            Body.AcisOut(path, dbobjectCollection);
        }
    }
}
